#include "FioriMenuTree.h"
#include <sstream>
using namespace std;


FioriMenuTree::FioriMenuTree(void)
{
}

FioriMenuTree::~FioriMenuTree(void)
{
}

vector<FioriMenuNode>& FioriMenuTree::getNodes()
{
	return m_nodes;
}

wstring FioriMenuTree::toString() const
{
	wstringstream ss;
	int i;

	ss << L"{menu:[";

	i = 0;
	for (auto it = m_nodes.cbegin(); it != m_nodes.cend(); it++, i++)
	{
		ss << it->toString();
		if(i > 0) ss << L",";
	}

	ss << L"]}";

	return ss.str();
}

bool FioriMenuTree::isChanged()
{
	return m_changed;
}

void FioriMenuTree::setChanged(bool flag)
{
	m_changed = flag;
}